package com.lagou.edu.service.impl;

import com.lagou.edu.service.LagouEmailService;
import com.lagou.edu.util.EmailUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

@Service
public class LagouEmailServiceImpl  implements LagouEmailService {

    @Value("config.email.host")
    private String emailHost;

    @Override
    public boolean sendEmail(String email, String emailTitle, String message) {

        try {
            //这里邮箱地址
            EmailUtils.sendEmail(emailHost, "15927030662@163.com", "", email, emailTitle, message);
            return true;
        } catch (Exception ex) {
            ex.printStackTrace();
            return false;
        }
    }
}
